﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlServerCe;

namespace CubaLibreBar.Model.Dados
{
    public static class ConnectionFactory
    {
        /// <summary>
        /// Retorna uma conexão com o banco de dados SQL COMPACT EDITION
        /// </summary>
        /// <returns></returns>
        public static SqlCeConnection GetConnection()
        {
            string executable = System.Reflection.Assembly.GetExecutingAssembly().Location;
            string path = (System.IO.Path.GetDirectoryName(executable));
            AppDomain.CurrentDomain.SetData("DataDirectory", path);

            return new SqlCeConnection(Properties.Settings.Default.cubaConnectionString);
        }
    }
}
